package app.base.systemmanage.systemrolesmanage.dao;

import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import app.base.systemmanage.systemrolesmanage.model.SysRoles;
import app.base.systemmanage.systemrolesmanage.model.SysRolesExample;
import app.base.systemmanage.systemrolesmanage.model.SysRolesKey;


public class SysRolesDAOImpl extends SqlMapClientDaoSupport implements SysRolesDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public SysRolesDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int countByExample(SysRolesExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("SYS_ROLES.ibatorgenerated_countByExample", example);
        return count.intValue();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int deleteByExample(SysRolesExample example) {
        int rows = getSqlMapClientTemplate().delete("SYS_ROLES.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int deleteByPrimaryKey(SysRolesKey key) {
        int rows = getSqlMapClientTemplate().delete("SYS_ROLES.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public void insert(SysRoles record) {
        getSqlMapClientTemplate().insert("SYS_ROLES.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public void insertSelective(SysRoles record) {
        getSqlMapClientTemplate().insert("SYS_ROLES.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public List selectByExample(SysRolesExample example) {
        List list = getSqlMapClientTemplate().queryForList("SYS_ROLES.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public SysRoles selectByPrimaryKey(SysRolesKey key) {
        SysRoles record = (SysRoles) getSqlMapClientTemplate().queryForObject("SYS_ROLES.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int updateByExampleSelective(SysRoles record, SysRolesExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("SYS_ROLES.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int updateByExample(SysRoles record, SysRolesExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("SYS_ROLES.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int updateByPrimaryKeySelective(SysRoles record) {
        int rows = getSqlMapClientTemplate().update("SYS_ROLES.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    public int updateByPrimaryKey(SysRoles record) {
        int rows = getSqlMapClientTemplate().update("SYS_ROLES.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table SYS_ROLES
     *
     * @ibatorgenerated Thu Jun 25 15:05:54 CST 2009
     */
    private static class UpdateByExampleParms extends SysRolesExample {
        private Object record;

        public UpdateByExampleParms(Object record, SysRolesExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
    
    //
    public void insert_0001(SysRoles record) {
        getSqlMapClientTemplate().insert("SYS_ROLES.insert_0001", record);
    }
    
    public int update_0001(SysRoles record) {
        int rows = getSqlMapClientTemplate().update("SYS_ROLES.update_0001", record);
        return rows;
    }
    
    public int delete_0001(SysRolesKey key) {
        int rows = getSqlMapClientTemplate().delete("SYS_ROLES.delete_0001", key);
        return rows;
    }
    
    @SuppressWarnings("unchecked")
	public List<SysRoles> select_0001(Map<String, Object> map) {
        List<SysRoles> list = getSqlMapClientTemplate().queryForList("SYS_ROLES.select_0001", map);
        return list;
    }
    
    public int count_0001(Map<String, Object> map) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("SYS_ROLES.count_0001", map);
        return count.intValue();    	
    }

    @SuppressWarnings("unchecked")
	public List<SysRoles> select_0002(java.util.Map<String, Object> map) {
        List<SysRoles> list = getSqlMapClientTemplate().queryForList("SYS_ROLES.select_0002", map);
        return list;
    }
}